﻿var Loader = (function() {
    var loadingScreen = $("#loading_screen");

    return {
        setLoadingScreenPercent: function(value, message) {
            if (value >= 0 && value < 100) {
                loadingScreen.show();
                loadingScreen.find('.progress').width(value / 100.0 * loadingScreen.width());

                if (message)
                    loadingScreen.find("span:first").html(message);
            } else loadingScreen.hide();
        }
    };
})();